#include "stm32f10x.h"                  // Device header
#include "Delay.h"
#include "PWM.h"
#include "Key.h"
#include "IC.h"
#include "OLED.h"
#include "Usart.h"
#include "String.h"
#include "LED.h"

uint8_t Tx_Array[4];
int main(void)
{
	NVIC_PriorityGroupConfig(NVIC_PriorityGroup_2);
	
	Usart1_Init();
	OLED_Init();
	LED_Init();
	
	OLED_ShowString(1,1,"Rx_Data:");
	while(1)
	{
		if (Usart1_GetRxFlag())
		{
			if (strcmp(Rx_Packet,"LED_ON") == 0)
			{
				LED1_ON();
				OLED_ShowString(2,1,"LED_ON_OK");
				Usart1_SendString("LED_ON_OK!");
				
			}
			else if (strcmp(Rx_Packet,"LED_OFF") == 0)
			{
				LED1_OFF();
				OLED_ShowString(2,1,"LED_OFF_OK");
				Usart1_SendString("LED_OFF_OK!");
			}	
			else
			{
				OLED_ShowString(2,1,"ERROR      ");
				Usart1_SendString("ERROR!");
			}
		}
	}
}


